<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <form name="form1">
        <h2>form1</h2>
        <p>
            hobbys
            <input type="checkbox" name="hobbys" value="css" checked> CSS
            <input type="checkbox" name="hobbys" value="html" checked> HTML
            <input type="checkbox" name="hobbys" value="js"> JS
            <input type="checkbox" name="hobbys" value="vue"> VUE
        </p>

    </form>
    <script>

        const r = [...document.form1.hobbys].filter(ele => ele.checked);
        console.log(r);

        // ['css','html']


    </script>
</body>

</html>